package com.skyhub.common.domain.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private Integer code;
    private String msg;
    private Object data;
    //success
    public static Result success(String msg){//无返回数据
        return new Result(200, msg, "ok~");
    }
    public static Result success(String msg,Object data){//有返回数据
        return new Result(200, msg, data);
    }
    //error
    public static Result error(String msg,Object data) {//统一错误处理
        return new Result(500, msg, data);
    }
}
